app.controller('AddCtrl', ['$scope', '$location', 'Recipe', '$state', function ($scope, $location, Recipe, $state) {

    $scope.data = [{}];
    $scope.save=function(){
      $location.path('/list');
    };

    $scope.uploadFiles = function (file) {
        $scope.uploadIng = true;
        toast.create('上传中!');
        Upload.upload(file).then(function (e) {
            $scope.data.imageUrl = e.url;
            toast.dismiss('上传成功！');
            $scope.uploadIng = false;
        });

    };
}]);